package com.maimang.platform.crm.shiro.realm;

import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * @author Rocky
 * @version 1.0.0
 * @classname UserToken
 * @description <br>无密码登录</br>
 * @date 2019-09-30 15:36
 * @email jintaozhao@qq.com
 */
public class UserToken extends UsernamePasswordToken {

	/**
	 * 是否需要密码验证
	 */
	private boolean passwordLess = false;

	public UserToken(String username, String password) {
		super(username, (password != null ? password.toCharArray() : null));
	}

	public UserToken(String username, String password, boolean rememberMe, boolean passwordLess) {
		super(username, (password != null ? password.toCharArray() : null), rememberMe);
		this.passwordLess = passwordLess;
	}

	public UserToken(String username, String password, boolean passwordLess) {
		super(username, (password != null ? password.toCharArray() : null));
		this.passwordLess = passwordLess;
	}


	public boolean isPasswordLess() {
		return passwordLess;
	}

	public void setPasswordLess(boolean passwordLess) {
		this.passwordLess = passwordLess;
	}
}
